import { createApp } from 'vue';
// import pinia from "./stores";
import ElementPlus from 'element-plus';
import zhCn from 'element-plus/dist/locale/zh-cn.mjs';
import 'element-plus/dist/index.css';
import App from './App.vue';
import router from './router';
// import "./styles/index.scss";
import ElSvg from './components/SvgIcon/ElSvg';
// import "./permission";
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import '@/assets/css/reset.css';
import i18n from './locales';
import store from './stores';
import 'amfe-flexible';
import '@/rem.js';
import jQuery from 'jquery';
import VueLazyload from 'vue-lazyload';
import logo from '@/assets/Snipaste.png';
// import "./mock/index.js"
// import { setupI18n } from '@/locales/setupI18n';

const app = createApp(App);
// setupI18n(app);
ElSvg(app);

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}

declare const window: any;
window.$ = window.jQuery = jQuery
app.config.warnHandler = (msg, instance, trace) => {};
app.config.errorHandler = (msg, instance, trace) => {}; //错误捕获，不报给浏览器
app
    // .use(pinia)
    .use(router)
    .use(ElementPlus)
    .use(i18n)
    .use(ElementPlus, {
        locale: zhCn,
    })
    .use(store)
    .use(VueLazyload, {
        loading: logo,
        error: logo,
    })
    .mount('#app');
